ScaleDataSourceImage
Definition:
ScaleDataSourceImage(sourcedatasource, sourcefield, targetdatasource, targetfield, width, height)
Description:
Create a scaled version of an image from an existing image, e.g. to allow you to create thumbnails of images which you can then display in a list view or to allow more images to be displayed on a single screen. The existing image must be held in a data column of a Data Source record and the scaled image must be written to another data column, in the same or a different Data Source.
Platforms:
Android
Parameters:
sourcedatasource - required
Data Source containing the original image – click here for the format of this parameter.
sourcefield - required
The column containing the original image.
targetdatasource - required
Data Source to which the scaled image will be written - click here for the format of this parameter.
targetfield - required
The column to contain the new image.
width - required
Width in pixels for the new image. Specify zero if you want to maintain the current aspect ratio of the original image based on a specified height measurement.
height - required
Height in pixels for the new image. Specify zero if you want to maintain the current aspect ratio of the original image based on a specified width measurement.
Returns:
nothing
Notes:
The source image will be taken from the current record of the source Data Source and the new image will be placed in the current record of the target Data Source. You will need to call UpdateCurrentRecord in order to commit the new image to the database.
Examples:
Create a thumbnail from source image to be 100x100 pixels, potentially losing aspect ratio:
ScaleDataSourceImage("Custom.Photos", "Photograph", "Custom.Photos", "Thumbnail", 100, 100)
Create a thumbnail from source image to be 100 pixels wide and maintain aspect ratio:
ScaleDataSourceImage("Custom.Photos", "Photograph", "Custom.Photos", "Thumbnail", 100, 0)
Create a thumbnail from source image to be 100 pixels high and maintain aspect ratio:
ScaleDataSourceImage("Custom.Photos", "Photograph", "Custom.Photos", "Thumbnail", 0, 100)